import {defineStore} from "pinia";

export const useUserStore = defineStore("icesoft-user", {

    state() {
        return {
            token: '',
            user: {}
        }
    },
    getters: {
        getToken(state) {
            return state.token
        },
        getUser(state) {
            return state.user
        }
    },
    actions: {
        setToken(token: string) {
            this.token = token;
        },
        setUser(data: any) {
            this.user = data
            this.token = data.token
        }
    }
})
